#include<stdio.h>

int main(void)
{
	int t,sum,paper=0;
	scanf("%d",&t);
	sum=100-t;
	printf("%d ",sum);
	if(sum>=50)
	{
		paper++;
		sum-=50;
	}
	while(sum>=10)
	{
		paper++;
		sum-=10;
	}
	while(sum>=5)
	{
		paper++;
		sum-=5;
	}
	while(sum>=2)
	{
		paper++;
		sum-=2;
	}
	paper+=sum;
	
	printf("%d",paper);
	
	return 0;
}
